home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 September / 1985-09.d64 / printer wedge (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  120 lines

  1. 10 bs=1358:s0=160:s1=32:d0=209:d1=81:m=1:mf(0)=1:forj=1to6:m=m*2:mf(j)=m:next
  2. 20 printchr$(147)chr$(5)"   printer wedge character designer"
  3. 30 printchr$(17)"move with cursor keys"
  4. 40 print"place dot with f7":print"erase dot with f8"
  5. 50 printchr$(17)"assign character with f1"
  6. 60 fori=1to5:printchr$(17):next:print"assign character string with f3"
  7. 70 print"activate wedge with f2"
  8. 80 ch=s0:fori=0to9:forj=0to6:gosub110:ar(i,j)=0:nextj:nexti
  9. 90 i=0:j=0:ch=s1:gosub110:goto140
  10. 100 i=0:j=0:ch=s1:gosub110:goto140
  11. 110 x=bs+i+j*40:pokex,ch:pokex+54272,1:return
  12. 120 getz$:ifz$=""then120
  13. 130 return
  14. 140 gosub120:dc=0:rem *character editor*
  15. 150 ifz$=chr$(29)thendc=1
  16. 160 ifz$=chr$(157)thendc=2
  17. 170 ifz$=chr$(17)thendc=3
  18. 180 ifz$=chr$(145)thendc=4
  19. 190 ifdc>0thengosub370:gosub380
  20. 200 ondcgosub290,310,330,350
  21. 210 gosub370:ifdc>0andlc=s0thench=s1:gosub110
  22. 220 ifdc>0andlc=d0thench=d1:gosub110
  23. 230 ifz$=chr$(136)thenar(i,j)=1:ch=d1:gosub110
  24. 240 ifz$=chr$(140)thenar(i,j)=0:ch=s1:gosub110
  25. 250 ifz$=chr$(133)then410
  26. 260 ifz$=chr$(137)thenprintchr$(147)chr$(17)"please wait":goto660
  27. 270 ifz$=chr$(134)then550
  28. 280 goto140
  29. 290 i=i+1:ifi>9theni=0
  30. 300 return
  31. 310 i=i-1:ifi<0theni=9
  32. 320 return
  33. 330 j=j+1:ifj>6thenj=0
  34. 340 return
  35. 350 j=j-1:ifj<0thenj=6
  36. 360 return
  37. 370 lc=peek(bs+i+j*40):return
  38. 380 iflc=s1thench=s0
  39. 390 iflc=d1thench=d0
  40. 400 gosub110:return
  41. 410 fori=0to9:rem *compute character*
  42. 420 cl(i)=128:forj=0to6:cl(i)=cl(i)+ar(i,j)*mf(j):nextj:nexti
  43. 430 print"assign character to which key?"
  44. 440 gosub120:z=asc(z$):b=3000+z*10:rem *print data statements*
  45. 450 printchr$(147)chr$(17)chr$(17)chr$(17)b"data"z"    ";
  46. 460 fori=0to9:ifcl(i)=128andcl(i+1)=128then480
  47. 470 print","cl(i)chr$(157);:nexti
  48. 480 print:fordx=1to5:print3000+z*10+dx:next
  49. 490 print"run"chr$(19);:forj=1to3:printchr$(17);:next
  50. 500 forj=1to14:printchr$(29);:next:print","ichr$(19)
  51. 510 ifi>0then540
  52. 520 printchr$(19);:forj=1to3:printchr$(17);:next
  53. 530 forj=1to20:printchr$(32);:next
  54. 540 poke198,9:fori=0to8:poke631+i,13:next:end
  55. 550 printchr$(147)"enter character string":inputa$:l=len(a$):ifl<1orl>39then550
  56. 560 print"assign to which key?":gosub120:dx=0:z=asc(z$):i=1:b=3000+z*10+dx
  57. 570 printchr$(147)chr$(17)chr$(17)chr$(17)b"data"z"    ,15,17";:lx=2
  58. 580 print","asc(mid$(a$,i,1))chr$(157);:lx=lx+1:i=i+1
  59. 590 iflx>9andi<=lthenlx=0:dx=dx+1:b=3000+z*10+dx:gosub650
  60. 600 ifi<=lthen580
  61. 610 print:fordx=dx+1to5:print3000+z*10+dx:next
  62. 620 print"run"chr$(19);:forj=1to3:printchr$(17);:next
  63. 630 forj=1to14:printchr$(29);:next:print","l+2
  64. 640 printchr$(19):poke198,9:fori=0to8:poke631+i,13:next:end
  65. 650 printchr$(13)b"data"asc(mid$(a$,i,1))chr$(157);:lx=lx+1:i=i+1:return
  66. 660 fori=57344to57452:rem poke hi code
  67. 670 reada:pokei,a:next
  68. 680 printchr$(147)"  where should pwedge be located?"
  69. 690 printchr$(17)"854   = cassette buffer"
  70. 700 print"679   = unused ram (maybe)"
  71. 710 print"49152 = reserved for ml programs"
  72. 720 printchr$(17)"location   854"chr$(157)chr$(157)chr$(157)chr$(157)chr$(157);
  73. 730 inputba:fori=batoba+59:reada:pokei,a:next
  74. 740 ifba=854then830
  75. 750 p=ba+60:gosub990:pokeba+10,l:pokeba+11,h:pokeba+49,l:pokeba+50,h
  76. 760 p=ba+61:gosub990:pokeba+13,l:pokeba+14,h:pokeba+52,l:pokeba+53,h
  77. 770 p=ba+62:gosub990:pokeba+1,l:pokeba+2,h:pokeba+55,l:pokeba+56,h
  78. 780 poke57354,l:poke57355,h:poke57449,l:poke57450,h
  79. 790 p=ba+64:gosub990:pokeba+39,l:pokeba+40,h:poke57409,l:poke57410,h
  80. 800 poke57425,l:poke57426,h:poke57437,l:poke57438,h
  81. 810 poke57443,l:poke57444,h
  82. 820 p=ba+25:gosub990:poke57395,l:poke57396,h
  83. 830 p=ba:gosub990:poke806,l:poke807,h
  84. 840 rem poke character data
  85. 850 i=57601:ct=0:z=i+256
  86. 860 readc:ifc=0thenpokez-257,ct:pokez+255,0:goto910
  87. 870 readl:if(l+i+3)>=zthen890
  88. 880 pokei,c:pokei+1,l:fork=1tol:reada:pokei+1+k,a:next:i=i+l+2:ct=ct+1:goto860
  89. 890 pokez-257,ct:ct=1:i=z:z=i+256:pokei,c:pokei+1,l
  90. 900 fork=1tol:reada:pokei+1+k,a:next:i=i+l+2:goto860
  91. 910 printchr$(147)"pwedge is now installed."
  92. 920 printchr$(17)"do you want a printer test?"
  93. 930 gosub120:ifz$<>"y"thenend
  94. 940 open4,4,7:print#4,"the quick brown fox jumped over the lazy dog."
  95. 950 fori=33to64:print#4,chr$(i);:next:print#4
  96. 960 fori=65to96:print#4,chr$(i);:next:print#4
  97. 970 fori=193to218:print#4,chr$(i);:next:print#4:close4
  98. 980 end
  99. 990 h=int(p/256):l=p-h*256:return
  100. 1000 rem *hi code*
  101. 1010 data 172,0,225,192,0,240,32,162,1,173
  102. 1020 data 148,3,221,0,225,240,36,232,138,24
  103. 1030 data 125,0,225,170,232,136,208,237,238,2
  104. 1040 data 224,238,14,224,238,22,224,208,217,169
  105. 1050 data 225,141,2,224,141,14,224,141,22,224
  106. 1060 data 76,111,3,173,2,224,141,70,224,141
  107. 1070 data 79,224,169,8,141,150,3,232,189,0
  108. 1080 data 225,141,109,224,160,1,232,189,0,225
  109. 1090 data 153,150,3,232,200,206,109,224,208,243
  110. 1100 data 169,128,153,150,3,200,169,15,153,150
  111. 1110 data 3,200,169,17,141,148,3,208,186
  112. 1200 rem *lo code*
  113. 1210 data 141,148,3,165,154,201,4,208,45,142
  114. 1220 data 146,3,140,147,3,120,165,1,41,253
  115. 1230 data 133,1,76,0,224,165,1,9,2,133
  116. 1240 data 1,88,192,0,240,12,162,0,189,150
  117. 1250 data 3,32,202,241,232,136,208,246,174,146
  118. 1260 data 3,172,147,3,173,148,3,76,202,241
  119. 10000 data 0
  120.